﻿using Daemon.Model;
using Daemon.Model;
using Microsoft.AspNetCore.Mvc;
using Daemon.Repository.Contract;
using System.Net.Http;
using Microsoft.AspNetCore.Http;
using Daemon.Common;
using Daemon.Service.Contract;

namespace DaemonAPI
{
	[ApiController]
	[Route("api/[controller]/[action]")]
	public class TakeAwayUserBookController : BaseApiController<TakeAwayUserBook, ITakeAwayUserBookRepository>
	{
		private readonly ITakeAwayUserBookService _takeAwayUserBookService;

		public TakeAwayUserBookController(ITakeAwayUserBookRepository repository, IHttpContextAccessor httpContextAccessor, ITakeAwayUserBookService takeAwayUserBookService) : base(repository, httpContextAccessor)
		{
			_takeAwayUserBookService = takeAwayUserBookService;
		}

		[HttpPost]
		[Route("")]
		public ResultModel BookBoard(TakeAwayUserBook entity)
		{
			return new ResultModel(System.Net.HttpStatusCode.OK, null, _takeAwayUserBookService.BookBoard(entity));
		}
	}
}
